package ynu.edu.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.List;

/**
 * Img2Img 请求DTO
 */
@Data
@ApiModel(description = "Img2Img 请求参数")
public class Img2ImgRequest {

    @ApiModelProperty(value = "模型名称", example = "img2img_normal", required = true)
    @NotBlank(message = "模型名称不能为空")
    private String modelName;

    @ApiModelProperty(value = "正面提示词", example = "a beautiful cat", required = true)
    @NotBlank(message = "提示词不能为空")
    private String prompt;

    @ApiModelProperty(value = "负面提示词", example = "ugly, blurry")
    private String negativePrompt;

    @ApiModelProperty(value = "初始图片base64编码", required = true)
    @NotBlank(message = "初始图片不能为空")
    private String initImage;

    @ApiModelProperty(value = "图片宽度", example = "512")
    @Min(value = 64, message = "图片宽度不能小于64")
    @Max(value = 2048, message = "图片宽度不能大于2048")
    private Integer width;

    @ApiModelProperty(value = "图片高度", example = "512")
    @Min(value = 64, message = "图片高度不能小于64")
    @Max(value = 2048, message = "图片高度不能大于2048")
    private Integer height;

    @ApiModelProperty(value = "去噪强度", example = "0.75")
    @DecimalMin(value = "0.0", message = "去噪强度不能小于0")
    @DecimalMax(value = "1.0", message = "去噪强度不能大于1")
    private BigDecimal denoisingStrength;

    @ApiModelProperty(value = "种子值", example = "1234567890")
    @Min(value = -1, message = "种子值不能小于-1")
    private Long seed;

    @ApiModelProperty(value = "采样器名称", example = "DPM++ 2M")
    private String samplerName;

    @ApiModelProperty(value = "调度器名称", example = "Karras")
    private String scheduler;

    @ApiModelProperty(value = "步数", example = "30")
    @Min(value = 1, message = "步数不能小于1")
    @Max(value = 150, message = "步数不能大于150")
    private Integer steps;

    @ApiModelProperty(value = "CFG比例", example = "7.0")
    @DecimalMin(value = "1.0", message = "CFG比例不能小于1")
    @DecimalMax(value = "30.0", message = "CFG比例不能大于30")
    private BigDecimal cfgScale;

    @ApiModelProperty(value = "批次大小", example = "1")
    @Min(value = 1, message = "批次大小不能小于1")
    @Max(value = 10, message = "批次大小不能大于10")
    private Integer batchSize;

    @ApiModelProperty(value = "面部修复", example = "false")
    private Boolean restoreFaces;

    @ApiModelProperty(value = "平铺模式", example = "false")
    private Boolean tiling;

    @ApiModelProperty(value = "模型覆盖设置")
    private java.util.Map<String, String> overrideSettings;

    @ApiModelProperty(value = "ControlNet单元列表")
    private List<ControlNetUnit> controlnetUnits;
} 